# Maintainer: Felix Yan <felixonmars@archlinux.org>

pkgname=python-itemloaders
pkgver=1.0.6
pkgrel=2
pkgdesc="Library to populate items using XPath and CSS with a convenient API"
url="https://github.com/scrapy/itemloaders"
license=('BSD')
arch=('any')
depends=('python-w3lib' 'python-parsel' 'python-jmespath' 'python-itemadapter')
makedepends=('python-setuptools')
checkdepends=('python-pytest')
source=("https://github.com/scrapy/itemloaders/archive/v$pkgver/$pkgname-$pkgver.tar.gz")
sha512sums=('60f81dcaca51b9050c2a4a3abcedc9328943eda353a26c1ad28e489c338ea9d18d9ce76333d3d832746ce636571a1e49965f897bba7c4081d805684bb2ec2682')

build() {
  cd itemloaders-$pkgver
  python setup.py build
}

check() {
  cd itemloaders-$pkgver
  python -m pytest
}

package() {
  cd itemloaders-$pkgver
  python setup.py install --root="$pkgdir" --optimize=1

  install -Dm644 LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname/
}
